<%@ page import="java.util.List" %>
<%@ page import="com.luzhikun.myshopping.domaim.User" %>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
  <title>主界面</title>
    <style type="text/css">
        .page{
            margin: 20px auto;
            align-content: center;
        }
        .page a{
            font-size: 16px;
            align-content: center;
            color: darkgreen;
        }
    </style>
</head>
<body>
<center>
        <h3 align="center">用户信息管理</h3>
   <table border='2' align='center'>
    <tr>
       <td> 商品编号 </td>
       <td> 商品名称 </td>
       <td> 生产日期 </td>
        <td> 生产厂家 </td>
        <td> 操作 </td>
        <td><a href='/myWeb/addProduct.jsp'>添加商品</a></td>
        </tr>
    <c:forEach items="${requestScope.products}" var="p">
    <tr>
        <td> ${p.pid} </td>
        <td> ${p.pname} </td>
        <td> ${p.pdate}</td>
        <td> ${p.pfactory} </td>
        <td><a href='/myWeb/product?action=delete&pid=${p.pid}'>删除商品</a></td>
        <td><a href='/myWeb/product?action=select&pid=${p.pid}'>查看详情</a></td>
       </tr>
    </c:forEach>
    </table>
    <div class="page">
        当前是第${pageNows},总页数为${pages}<br>
        <%-- 当前页减1 --%>
            <c:if test="${pageNows}<=1">
                <
            </c:if>
            <c:if test="${pageNows > 1 }">
             <a href="show?pn=${pageNows-1}">&lt;</a>
            </c:if>
        <c:forEach begin="1" end="${pages}" var="i">
            <a href="/myWeb/show?pn=${i}">${i}</a>
        </c:forEach>
        <c:if test="${pageNows >= pages}">
            >
        </c:if>
        <c:if test="${pageNows < pages}">
            <a href="show?pn=${pageNows+1}">&gt;</a>
        </c:if>
    </div>
    <a href='/myWeb/loginServlet?action=logout'>退出登录</a>
</center>
</body>
</html>